#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    float x,term=0,sum=0,n,i;
    cout<<"\tEnter the value of x :";
    cin>>x;
    cout<<"\tEnter the no. of terms :";
    cin>>n;
    for(i=0;i<n;i++)
    {
        term=pow((x-1)/(x+1),(2*i+1))/(2*i+1);
        sum+=term;
    }
    cout<<"\tlog("<<x<<")="<<2*sum;
    cin.get();
}
